BIN=processbar
CC=gcc
SRC=$(wildcard *.c)
OBJ=$(SRC:.c=.o)
LFLAGS=-o
FLAGS=-c
RM=rm -f

$(BIN):$(OBJ)
	@$(CC) $(LFLAGS) $@ $^
	@echo "linking ... $@ to $^"
%.o :%.c
	@$(CC) $(FLAGS) $< -g  -std=c99  #调试信息
	@echo "compiling ... $< to $@"

.PHONY:clean #伪目标
clean:
	$(RM) $(OBJ) $(BIN)

.PHONY:test
test:
	@echo $(SRC)
	@echo $(BIN)


